package org.itboys.mobile.service.mongo.web;

import org.itboys.mobile.entity.mongo.SundayMessage;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.itboys.param.PageResult;
import org.itboys.param.ParamUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 作者：zzq
 * 时间：2017/11/10
 * 描述：野夫摄影_购物留言
 */
@Service
public class SundayWebMessageService extends BaseMongoService<SundayMessage>{
    @Resource(name = "mobileDs")
    private MongoDataSource yefuDataSource;
    @Override
    protected MongoDataSource getMongoDataSource() {
        return yefuDataSource;
    }

    @Override
    protected Class<SundayMessage> getEntityClass() {
        return SundayMessage.class;
    }

    public PageResult<SundayMessage> select(HttpServletRequest request){
        Map<String,Object> param = ParamUtil.packageMongoExactParam(request);
        param.put("isDeleted", 0);
        Map<String,String> containsparam = ParamUtil.packageMongoVagueParam(request,"memberName");
        PageResult<SundayMessage> result=super.containpageQuery(request,containsparam,param);
        return result;
    }
}
